$(function() {
	getSearchInfo();
});
/********************使用cookie**************************************/
function setSearchInfo(page){
	
	
	var cfcs=$("#cfcs").val();
	var ddcs=$("#ddcs").val();
	var hbyear = $("#year").val();
	var hbmonth = $("#month").val();
	var hbday = $("#day").val();
	if(page == 1){
		var adult = $("#adult").val();
		var child = $("#child").val();
		var infant = $("#infant").val();
		$.cookie('adult', adult);
		$.cookie('child', child); 
		$.cookie('infant', infant);
	}
	if(page == 2){
		$.cookie('adult', 1);
		$.cookie('child', 0); 
		$.cookie('infant', 0); 
	}
	$.cookie('cfcs', cfcs); 
	$.cookie('ddcs', ddcs); 
	$.cookie('hbyear', hbyear);
	$.cookie('hbmonth', hbmonth); 
	$.cookie('hbday', hbday); 
}
function getSearchInfo(){
	var adult = $.cookie("adult");
	
	if(adult != "undefined" ){
		
		var child = $.cookie("child");
		var infant = $.cookie("infant");
		var cfcs = $.cookie("cfcs");
		var ddcs = $.cookie("ddcs");
		var hbyear = $.cookie("hbyear");
		var hbmonth = $.cookie("hbmonth");
		var hbday = $.cookie("hbday");
//		alert(hbyear+"  "+hbmonth+"  "+hbday)

		$("#adult").find("option:contains("+adult+")").attr("selected",true);
		$("#child").find("option:contains("+child+")").attr("selected",true);
		$("#infant").find("option:contains("+infant+")").attr("selected",true);
		
		if(cfcs == 'SWA'){
			alert(1)
			$("#cfcs").find("option[mark=JY]").attr("selected",true);
		}else{
			$("#cfcs").find("option[value="+cfcs+"]").attr("selected",true);
		}
		if(ddcs == 'SWA'){
			$("#ddcs").find("option[mark=JY]").attr("selected",true);
		}else{
			$("#ddcs").find("option[value="+ddcs+"]").attr("selected",true);
		}

		$("#year").find("option:contains("+hbyear+")").attr("selected",true);
		$("#month").find("option:contains("+hbmonth+")").attr("selected",true);
		$("#day").find("option:contains("+hbday+")").attr("selected",true);		
	}
}

